package com.example.demo.controller;

import com.example.demo.service.OrderService;
import com.example.demo.web.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping(value = "/order", produces = "application/json")
    public AjaxResult order(String userId, String commodityCode, Integer orderCount) {

        return orderService.order(userId,commodityCode,orderCount);

    }

}
